
<!DOCTYPE HTML>
<html lang="zh-hans" >
    <head>
        <meta charset="UTF-8">
        <meta content="text/html; charset=utf-8" http-equiv="Content-Type">
        <title>State · Gitbook demo</title>
        <meta http-equiv="X-UA-Compatible" content="IE=edge" />
        <meta name="description" content="">
        <meta name="generator" content="GitBook 3.2.2">
        <meta name="author" content="lanyue">
        
        
    
    <link rel="stylesheet" href="gitbook/style.css">

    
            
                
                <link rel="stylesheet" href="gitbook/gitbook-plugin-highlight/website.css">
                
            
                
                <link rel="stylesheet" href="gitbook/gitbook-plugin-search/search.css">
                
            
                
                <link rel="stylesheet" href="gitbook/gitbook-plugin-fontsettings/website.css">
                
            
        

    

    
        
    
        
    
        
    
        
    
        
    
        
    

        
    
    
    <meta name="HandheldFriendly" content="true"/>
    <meta name="viewport" content="width=device-width, initial-scale=1, user-scalable=no">
    <meta name="apple-mobile-web-app-capable" content="yes">
    <meta name="apple-mobile-web-app-status-bar-style" content="black">
    <link rel="apple-touch-icon-precomposed" sizes="152x152" href="gitbook/images/apple-touch-icon-precomposed-152.png">
    <link rel="shortcut icon" href="gitbook/images/favicon.ico" type="image/x-icon">

    
    <link rel="next" href="getters.html" />
    
    

    </head>
    <body>
        
<div class="book">
    <div class="book-summary">
        
            
<div id="book-search-input" role="search">
    <input type="text" placeholder="输入并搜索" />
</div>

            
                <nav role="navigation">
                


<ul class="summary">
    
    

    

    
        
        
    
        <li class="chapter " data-level="1.1" data-path="./">
            
                <a href="./">
            
                    
                    Introduction
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="1.2" >
            
                <a target="_blank" href="https://github.com/vuejs/vuex/tree/1.0/docs">
            
                    
                    寻找 1.0 文档？
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="1.3" >
            
                <a target="_blank" href="https://github.com/vuejs/vuex/releases">
            
                    
                    更新记录
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="1.4" data-path="installation.html">
            
                <a href="installation.html">
            
                    
                    安装
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="1.5" data-path="intro.html">
            
                <a href="intro.html">
            
                    
                    Vuex 是什么？
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="1.6" data-path="getting-started.html">
            
                <a href="getting-started.html">
            
                    
                    开始
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="1.7" >
            
                <span>
            
                    
                    核心概念
            
                </span>
            

            
            <ul class="articles">
                
    
        <li class="chapter active" data-level="1.7.1" data-path="state.html">
            
                <a href="state.html">
            
                    
                    State
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="1.7.2" data-path="getters.html">
            
                <a href="getters.html">
            
                    
                    Getters
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="1.7.3" data-path="mutations.html">
            
                <a href="mutations.html">
            
                    
                    Mutations
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="1.7.4" data-path="actions.html">
            
                <a href="actions.html">
            
                    
                    Actions
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="1.7.5" data-path="modules.html">
            
                <a href="modules.html">
            
                    
                    Modules
            
                </a>
            

            
        </li>
    

            </ul>
            
        </li>
    
        <li class="chapter " data-level="1.8" data-path="structure.html">
            
                <a href="structure.html">
            
                    
                    项目结构
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="1.9" data-path="plugins.html">
            
                <a href="plugins.html">
            
                    
                    插件
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="1.10" data-path="strict.html">
            
                <a href="strict.html">
            
                    
                    严格模式
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="1.11" data-path="forms.html">
            
                <a href="forms.html">
            
                    
                    表单处理
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="1.12" data-path="testing.html">
            
                <a href="testing.html">
            
                    
                    测试
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="1.13" data-path="hot-reload.html">
            
                <a href="hot-reload.html">
            
                    
                    热重载
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="1.14" data-path="api.html">
            
                <a href="api.html">
            
                    
                    API 文档
            
                </a>
            

            
        </li>
    

    

    <li class="divider"></li>

    <li>
        <a href="https://www.gitbook.com" target="blank" class="gitbook-link">
            本书使用 GitBook 发布
        </a>
    </li>
</ul>


                </nav>
            
        
    </div>

    <div class="book-body">
        
            <div class="body-inner">
                
                    

<div class="book-header" role="navigation">
    

    <!-- Title -->
    <h1>
        <i class="fa fa-circle-o-notch fa-spin"></i>
        <a href="." >State</a>
    </h1>
</div>




                    <div class="page-wrapper" tabindex="-1" role="main">
                        <div class="page-inner">
                            
<div id="book-search-results">
    <div class="search-noresults">
    
                                <section class="normal markdown-section">
                                
                                <h1 id="state">State</h1>
<h3 id="&#x5355;&#x4E00;&#x72B6;&#x6001;&#x6811;">&#x5355;&#x4E00;&#x72B6;&#x6001;&#x6811;</h3>
<p>Vuex &#x4F7F;&#x7528; <strong>&#x5355;&#x4E00;&#x72B6;&#x6001;&#x6811;</strong> &#x2014;&#x2014; &#x662F;&#x7684;&#xFF0C;&#x7528;&#x4E00;&#x4E2A;&#x5BF9;&#x8C61;&#x5C31;&#x5305;&#x542B;&#x4E86;&#x5168;&#x90E8;&#x7684;&#x5E94;&#x7528;&#x5C42;&#x7EA7;&#x72B6;&#x6001;&#x3002;&#x81F3;&#x6B64;&#x5B83;&#x4FBF;&#x4F5C;&#x4E3A;&#x4E00;&#x4E2A;&#x300E;&#x552F;&#x4E00;&#x6570;&#x636E;&#x6E90;(<a href="https://en.wikipedia.org/wiki/Single_source_of_truth" target="_blank">SSOT</a>)&#x300F;&#x800C;&#x5B58;&#x5728;&#x3002;&#x8FD9;&#x4E5F;&#x610F;&#x5473;&#x7740;&#xFF0C;&#x6BCF;&#x4E2A;&#x5E94;&#x7528;&#x5C06;&#x4EC5;&#x4EC5;&#x5305;&#x542B;&#x4E00;&#x4E2A; store &#x5B9E;&#x4F8B;&#x3002;&#x5355;&#x4E00;&#x72B6;&#x6001;&#x6811;&#x8BA9;&#x6211;&#x4EEC;&#x80FD;&#x591F;&#x76F4;&#x63A5;&#x5730;&#x5B9A;&#x4F4D;&#x4EFB;&#x4E00;&#x7279;&#x5B9A;&#x7684;&#x72B6;&#x6001;&#x7247;&#x6BB5;&#xFF0C;&#x5728;&#x8C03;&#x8BD5;&#x7684;&#x8FC7;&#x7A0B;&#x4E2D;&#x4E5F;&#x80FD;&#x8F7B;&#x6613;&#x5730;&#x53D6;&#x5F97;&#x6574;&#x4E2A;&#x5F53;&#x524D;&#x5E94;&#x7528;&#x72B6;&#x6001;&#x7684;&#x5FEB;&#x7167;&#x3002;</p>
<p>&#x5355;&#x72B6;&#x6001;&#x6811;&#x548C;&#x6A21;&#x5757;&#x5316;&#x5E76;&#x4E0D;&#x51B2;&#x7A81; &#x2014;&#x2014; &#x5728;&#x540E;&#x9762;&#x7684;&#x7AE0;&#x8282;&#x91CC;&#x6211;&#x4EEC;&#x4F1A;&#x8BA8;&#x8BBA;&#x5982;&#x4F55;&#x5C06;&#x72B6;&#x6001;&#x548C;&#x72B6;&#x6001;&#x53D8;&#x66F4;&#x4E8B;&#x4EF6;&#x5206;&#x5E03;&#x5230;&#x5404;&#x4E2A;&#x5B50;&#x6A21;&#x5757;&#x4E2D;&#x3002;</p>
<h3 id="&#x5728;-vue-&#x7EC4;&#x4EF6;&#x4E2D;&#x83B7;&#x5F97;-vuex-&#x72B6;&#x6001;">&#x5728; Vue &#x7EC4;&#x4EF6;&#x4E2D;&#x83B7;&#x5F97; Vuex &#x72B6;&#x6001;</h3>
<p>&#x90A3;&#x4E48;&#x6211;&#x4EEC;&#x5982;&#x4F55;&#x5728; Vue &#x7EC4;&#x4EF6;&#x4E2D;&#x5C55;&#x793A;&#x72B6;&#x6001;&#x5462;&#xFF1F;&#x7531;&#x4E8E; Vuex &#x7684;&#x72B6;&#x6001;&#x5B58;&#x50A8;&#x662F;&#x54CD;&#x5E94;&#x5F0F;&#x7684;&#xFF0C;&#x4ECE; store &#x5B9E;&#x4F8B;&#x4E2D;&#x8BFB;&#x53D6;&#x72B6;&#x6001;&#x6700;&#x7B80;&#x5355;&#x7684;&#x65B9;&#x6CD5;&#x5C31;&#x662F;&#x5728;<a href="http://cn.vuejs.org/guide/computed.html" target="_blank">&#x8BA1;&#x7B97;&#x5C5E;&#x6027;</a>&#x4E2D;&#x8FD4;&#x56DE;&#x67D0;&#x4E2A;&#x72B6;&#x6001;&#xFF1A;</p>
<pre><code class="lang-js"><span class="hljs-comment">// &#x521B;&#x5EFA;&#x4E00;&#x4E2A; Counter &#x7EC4;&#x4EF6;</span>
<span class="hljs-keyword">const</span> Counter = {
  template: <span class="hljs-string">`&lt;div&gt;{{ count }}&lt;/div&gt;`</span>,
  computed: {
    count () {
      <span class="hljs-keyword">return</span> store.state.count
    }
  }
}
</code></pre>
<p>&#x6BCF;&#x5F53; <code>store.state.count</code> &#x53D8;&#x5316;&#x7684;&#x65F6;&#x5019;, &#x90FD;&#x4F1A;&#x91CD;&#x65B0;&#x6C42;&#x53D6;&#x8BA1;&#x7B97;&#x5C5E;&#x6027;&#xFF0C;&#x5E76;&#x4E14;&#x89E6;&#x53D1;&#x66F4;&#x65B0;&#x76F8;&#x5173;&#x8054;&#x7684; DOM&#x3002;</p>
<p>&#x7136;&#x800C;&#xFF0C;&#x8FD9;&#x79CD;&#x6A21;&#x5F0F;&#x5BFC;&#x81F4;&#x7EC4;&#x4EF6;&#x4F9D;&#x8D56;&#x7684;&#x5168;&#x5C40;&#x72B6;&#x6001;&#x5355;&#x4F8B;&#x3002;&#x5728;&#x6A21;&#x5757;&#x5316;&#x7684;&#x6784;&#x5EFA;&#x7CFB;&#x7EDF;&#x4E2D;&#xFF0C;&#x5728;&#x6BCF;&#x4E2A;&#x9700;&#x8981;&#x4F7F;&#x7528; state &#x7684;&#x7EC4;&#x4EF6;&#x4E2D;&#x9700;&#x8981;&#x9891;&#x7E41;&#x5730;&#x5BFC;&#x5165;&#xFF0C;&#x5E76;&#x4E14;&#x5728;&#x6D4B;&#x8BD5;&#x7EC4;&#x4EF6;&#x65F6;&#x9700;&#x8981;&#x6A21;&#x62DF;&#x72B6;&#x6001;&#x3002;</p>
<p>Vuex &#x901A;&#x8FC7; <code>store</code> &#x9009;&#x9879;&#xFF0C;&#x63D0;&#x4F9B;&#x4E86;&#x4E00;&#x79CD;&#x673A;&#x5236;&#x5C06;&#x72B6;&#x6001;&#x4ECE;&#x6839;&#x7EC4;&#x4EF6;&#x300E;&#x6CE8;&#x5165;&#x300F;&#x5230;&#x6BCF;&#x4E00;&#x4E2A;&#x5B50;&#x7EC4;&#x4EF6;&#x4E2D;&#xFF08;&#x9700;&#x8C03;&#x7528; <code>Vue.use(Vuex)</code>&#xFF09;&#xFF1A;</p>
<pre><code class="lang-js"><span class="hljs-keyword">const</span> app = <span class="hljs-keyword">new</span> Vue({
  el: <span class="hljs-string">&apos;#app&apos;</span>,
  <span class="hljs-comment">// &#x628A; store &#x5BF9;&#x8C61;&#x63D0;&#x4F9B;&#x7ED9; &#x201C;store&#x201D; &#x9009;&#x9879;&#xFF0C;&#x8FD9;&#x53EF;&#x4EE5;&#x628A; store &#x7684;&#x5B9E;&#x4F8B;&#x6CE8;&#x5165;&#x6240;&#x6709;&#x7684;&#x5B50;&#x7EC4;&#x4EF6;</span>
  store,
  components: { Counter },
  template: <span class="hljs-string">`
    &lt;div class=&quot;app&quot;&gt;
      &lt;counter&gt;&lt;/counter&gt;
    &lt;/div&gt;
  `</span>
})
</code></pre>
<p>&#x901A;&#x8FC7;&#x5728;&#x6839;&#x5B9E;&#x4F8B;&#x4E2D;&#x6CE8;&#x518C; <code>store</code> &#x9009;&#x9879;&#xFF0C;&#x8BE5; store &#x5B9E;&#x4F8B;&#x4F1A;&#x6CE8;&#x5165;&#x5230;&#x6839;&#x7EC4;&#x4EF6;&#x4E0B;&#x7684;&#x6240;&#x6709;&#x5B50;&#x7EC4;&#x4EF6;&#x4E2D;&#xFF0C;&#x4E14;&#x5B50;&#x7EC4;&#x4EF6;&#x80FD;&#x901A;&#x8FC7; <code>this.$store</code> &#x8BBF;&#x95EE;&#x5230;&#x3002;&#x8BA9;&#x6211;&#x4EEC;&#x66F4;&#x65B0;&#x4E0B; <code>Counter</code> &#x7684;&#x5B9E;&#x73B0;&#xFF1A;</p>
<pre><code class="lang-js"><span class="hljs-keyword">const</span> Counter = {
  template: <span class="hljs-string">`&lt;div&gt;{{ count }}&lt;/div&gt;`</span>,
  computed: {
    count () {
      <span class="hljs-keyword">return</span> <span class="hljs-keyword">this</span>.$store.state.count
    }
  }
}
</code></pre>
<h3 id="mapstate-&#x8F85;&#x52A9;&#x51FD;&#x6570;"><code>mapState</code> &#x8F85;&#x52A9;&#x51FD;&#x6570;</h3>
<p>&#x5F53;&#x4E00;&#x4E2A;&#x7EC4;&#x4EF6;&#x9700;&#x8981;&#x83B7;&#x53D6;&#x591A;&#x4E2A;&#x72B6;&#x6001;&#x65F6;&#x5019;&#xFF0C;&#x5C06;&#x8FD9;&#x4E9B;&#x72B6;&#x6001;&#x90FD;&#x58F0;&#x660E;&#x4E3A;&#x8BA1;&#x7B97;&#x5C5E;&#x6027;&#x4F1A;&#x6709;&#x4E9B;&#x91CD;&#x590D;&#x548C;&#x5197;&#x4F59;&#x3002;&#x4E3A;&#x4E86;&#x89E3;&#x51B3;&#x8FD9;&#x4E2A;&#x95EE;&#x9898;&#xFF0C;&#x6211;&#x4EEC;&#x53EF;&#x4EE5;&#x4F7F;&#x7528; <code>mapState</code> &#x8F85;&#x52A9;&#x51FD;&#x6570;&#x5E2E;&#x52A9;&#x6211;&#x4EEC;&#x751F;&#x6210;&#x8BA1;&#x7B97;&#x5C5E;&#x6027;&#xFF0C;&#x8BA9;&#x4F60;&#x5C11;&#x6309;&#x51E0;&#x6B21;&#x952E;&#xFF1A;</p>
<pre><code class="lang-js"><span class="hljs-comment">// &#x5728;&#x5355;&#x72EC;&#x6784;&#x5EFA;&#x7684;&#x7248;&#x672C;&#x4E2D;&#x8F85;&#x52A9;&#x51FD;&#x6570;&#x4E3A; Vuex.mapState</span>
<span class="hljs-keyword">import</span> { mapState } <span class="hljs-keyword">from</span> <span class="hljs-string">&apos;vuex&apos;</span>

<span class="hljs-keyword">export</span> <span class="hljs-keyword">default</span> {
  <span class="hljs-comment">// ...</span>
  computed: mapState({
    <span class="hljs-comment">// &#x7BAD;&#x5934;&#x51FD;&#x6570;&#x53EF;&#x4F7F;&#x4EE3;&#x7801;&#x66F4;&#x7B80;&#x7EC3;</span>
    count: state =&gt; state.count,

    <span class="hljs-comment">// &#x4F20;&#x5B57;&#x7B26;&#x4E32;&#x53C2;&#x6570; &apos;count&apos; &#x7B49;&#x540C;&#x4E8E; `state =&gt; state.count`</span>
    countAlias: <span class="hljs-string">&apos;count&apos;</span>,

    <span class="hljs-comment">// &#x4E3A;&#x4E86;&#x80FD;&#x591F;&#x4F7F;&#x7528; `this` &#x83B7;&#x53D6;&#x5C40;&#x90E8;&#x72B6;&#x6001;&#xFF0C;&#x5FC5;&#x987B;&#x4F7F;&#x7528;&#x5E38;&#x89C4;&#x51FD;&#x6570;</span>
    countPlusLocalState (state) {
      <span class="hljs-keyword">return</span> state.count + <span class="hljs-keyword">this</span>.localCount
    }
  })
}
</code></pre>
<p>&#x5F53;&#x6620;&#x5C04;&#x7684;&#x8BA1;&#x7B97;&#x5C5E;&#x6027;&#x7684;&#x540D;&#x79F0;&#x4E0E; state &#x7684;&#x5B50;&#x8282;&#x70B9;&#x540D;&#x79F0;&#x76F8;&#x540C;&#x65F6;&#xFF0C;&#x6211;&#x4EEC;&#x4E5F;&#x53EF;&#x4EE5;&#x7ED9; <code>mapState</code> &#x4F20;&#x4E00;&#x4E2A;&#x5B57;&#x7B26;&#x4E32;&#x6570;&#x7EC4;&#x3002;</p>
<pre><code class="lang-js">computed: mapState([
  <span class="hljs-comment">// &#x6620;&#x5C04; this.count &#x4E3A; store.state.count</span>
  <span class="hljs-string">&apos;count&apos;</span>
])
</code></pre>
<h3 id="&#x5BF9;&#x8C61;&#x5C55;&#x5F00;&#x8FD0;&#x7B97;&#x7B26;">&#x5BF9;&#x8C61;&#x5C55;&#x5F00;&#x8FD0;&#x7B97;&#x7B26;</h3>
<p><code>mapState</code> &#x51FD;&#x6570;&#x8FD4;&#x56DE;&#x7684;&#x662F;&#x4E00;&#x4E2A;&#x5BF9;&#x8C61;&#x3002;&#x6211;&#x4EEC;&#x5982;&#x4F55;&#x5C06;&#x5B83;&#x4E0E;&#x5C40;&#x90E8;&#x8BA1;&#x7B97;&#x5C5E;&#x6027;&#x6DF7;&#x5408;&#x4F7F;&#x7528;&#x5462;&#xFF1F;&#x901A;&#x5E38;&#xFF0C;&#x6211;&#x4EEC;&#x9700;&#x8981;&#x4F7F;&#x7528;&#x4E00;&#x4E2A;&#x5DE5;&#x5177;&#x51FD;&#x6570;&#x5C06;&#x591A;&#x4E2A;&#x5BF9;&#x8C61;&#x5408;&#x5E76;&#x4E3A;&#x4E00;&#x4E2A;&#xFF0C;&#x4EE5;&#x4F7F;&#x6211;&#x4EEC;&#x53EF;&#x4EE5;&#x5C06;&#x6700;&#x7EC8;&#x5BF9;&#x8C61;&#x4F20;&#x7ED9; <code>computed</code> &#x5C5E;&#x6027;&#x3002;&#x4F46;&#x662F;&#x81EA;&#x4ECE;&#x6709;&#x4E86;<a href="https://github.com/sebmarkbage/ecmascript-rest-spread" target="_blank">&#x5BF9;&#x8C61;&#x5C55;&#x5F00;&#x8FD0;&#x7B97;&#x7B26;</a>&#xFF08;&#x73B0;&#x5904;&#x4E8E; ECMASCript &#x63D0;&#x6848; stage-3 &#x9636;&#x6BB5;&#xFF09;&#xFF0C;&#x6211;&#x4EEC;&#x53EF;&#x4EE5;&#x6781;&#x5927;&#x5730;&#x7B80;&#x5316;&#x5199;&#x6CD5;&#xFF1A;</p>
<pre><code class="lang-js">computed: {
  localComputed () { <span class="hljs-comment">/* ... */</span> },
  <span class="hljs-comment">// &#x4F7F;&#x7528;&#x5BF9;&#x8C61;&#x5C55;&#x5F00;&#x8FD0;&#x7B97;&#x7B26;&#x5C06;&#x6B64;&#x5BF9;&#x8C61;&#x6DF7;&#x5165;&#x5230;&#x5916;&#x90E8;&#x5BF9;&#x8C61;&#x4E2D;</span>
  ...mapState({
    <span class="hljs-comment">// ...</span>
  })
}
</code></pre>
<h3 id="&#x7EC4;&#x4EF6;&#x4ECD;&#x7136;&#x4FDD;&#x6709;&#x5C40;&#x90E8;&#x72B6;&#x6001;">&#x7EC4;&#x4EF6;&#x4ECD;&#x7136;&#x4FDD;&#x6709;&#x5C40;&#x90E8;&#x72B6;&#x6001;</h3>
<p>&#x4F7F;&#x7528; Vuex &#x5E76;&#x4E0D;&#x610F;&#x5473;&#x7740;&#x4F60;&#x9700;&#x8981;&#x5C06;<strong>&#x6240;&#x6709;&#x7684;</strong>&#x72B6;&#x6001;&#x653E;&#x5165; Vuex&#x3002;&#x867D;&#x7136;&#x5C06;&#x6240;&#x6709;&#x7684;&#x72B6;&#x6001;&#x653E;&#x5230; Vuex &#x4F1A;&#x4F7F;&#x72B6;&#x6001;&#x53D8;&#x5316;&#x66F4;&#x663E;&#x5F0F;&#x548C;&#x6613;&#x8C03;&#x8BD5;&#xFF0C;&#x4F46;&#x4E5F;&#x4F1A;&#x4F7F;&#x4EE3;&#x7801;&#x53D8;&#x5F97;&#x5197;&#x957F;&#x548C;&#x4E0D;&#x76F4;&#x89C2;&#x3002;&#x5982;&#x679C;&#x6709;&#x4E9B;&#x72B6;&#x6001;&#x4E25;&#x683C;&#x5C5E;&#x4E8E;&#x5355;&#x4E2A;&#x7EC4;&#x4EF6;&#xFF0C;&#x6700;&#x597D;&#x8FD8;&#x662F;&#x4F5C;&#x4E3A;&#x7EC4;&#x4EF6;&#x7684;&#x5C40;&#x90E8;&#x72B6;&#x6001;&#x3002;&#x4F60;&#x5E94;&#x8BE5;&#x6839;&#x636E;&#x4F60;&#x7684;&#x5E94;&#x7528;&#x5F00;&#x53D1;&#x9700;&#x8981;&#x8FDB;&#x884C;&#x6743;&#x8861;&#x548C;&#x786E;&#x5B9A;&#x3002;</p>

                                
                                </section>
                            
    </div>
    <div class="search-results">
        <div class="has-results">
            
            <h1 class="search-results-title"><span class='search-results-count'></span> results matching "<span class='search-query'></span>"</h1>
            <ul class="search-results-list"></ul>
            
        </div>
        <div class="no-results">
            
            <h1 class="search-results-title">No results matching "<span class='search-query'></span>"</h1>
            
        </div>
    </div>
</div>

                        </div>
                    </div>
                
            </div>

            
                
                
                <a href="getters.html" class="navigation navigation-next navigation-unique" aria-label="Next page: Getters">
                    <i class="fa fa-angle-right"></i>
                </a>
                
            
        
    </div>

    <script>
        var gitbook = gitbook || [];
        gitbook.push(function() {
            gitbook.page.hasChanged({"page":{"title":"State","level":"1.7.1","depth":2,"next":{"title":"Getters","level":"1.7.2","depth":2,"path":"getters.md","ref":"getters.md","articles":[]},"previous":{"title":"核心概念","level":"1.7","depth":1,"ref":"","articles":[{"title":"State","level":"1.7.1","depth":2,"path":"state.md","ref":"state.md","articles":[]},{"title":"Getters","level":"1.7.2","depth":2,"path":"getters.md","ref":"getters.md","articles":[]},{"title":"Mutations","level":"1.7.3","depth":2,"path":"mutations.md","ref":"mutations.md","articles":[]},{"title":"Actions","level":"1.7.4","depth":2,"path":"actions.md","ref":"actions.md","articles":[]},{"title":"Modules","level":"1.7.5","depth":2,"path":"modules.md","ref":"modules.md","articles":[]}]},"dir":"ltr"},"config":{"plugins":[],"root":"./","styles":{"website":"styles/website.css","pdf":"styles/pdf.css","epub":"styles/epub.css","mobi":"styles/mobi.css","ebook":"styles/ebook.css","print":"styles/print.css"},"pluginsConfig":{"highlight":{},"search":{},"lunr":{"maxIndexSize":1000000,"ignoreSpecialCharacters":false},"sharing":{"facebook":true,"twitter":true,"google":false,"weibo":false,"instapaper":false,"vk":false,"all":["facebook","google","twitter","weibo","instapaper"]},"fontsettings":{"theme":"white","family":"sans","size":2},"theme-default":{"styles":{"website":"styles/website.css","pdf":"styles/pdf.css","epub":"styles/epub.css","mobi":"styles/mobi.css","ebook":"styles/ebook.css","print":"styles/print.css"},"showLevel":false}},"theme":"default","author":"lanyue","pdf":{"pageNumbers":true,"fontSize":12,"fontFamily":"Arial","paperSize":"a4","chapterMark":"pagebreak","pageBreaksBefore":"/","margin":{"right":62,"left":62,"top":56,"bottom":56}},"structure":{"langs":"LANGS.md","readme":"README.md","glossary":"GLOSSARY.md","summary":"SUMMARY.md"},"variables":{},"title":"Gitbook demo","language":"zh-hans","gitbook":">=3.0.0","description":"this is a test"},"file":{"path":"state.md","mtime":"2017-02-21T09:41:56.411Z","type":"markdown"},"gitbook":{"version":"3.2.2","time":"2017-03-06T15:58:45.473Z"},"basePath":".","book":{"language":""}});
        });
    </script>
</div>

        
    <script src="gitbook/gitbook.js"></script>
    <script src="gitbook/theme.js"></script>
    
        
        <script src="gitbook/gitbook-plugin-search/search-engine.js"></script>
        
    
        
        <script src="gitbook/gitbook-plugin-search/search.js"></script>
        
    
        
        <script src="gitbook/gitbook-plugin-lunr/lunr.min.js"></script>
        
    
        
        <script src="gitbook/gitbook-plugin-lunr/search-lunr.js"></script>
        
    
        
        <script src="gitbook/gitbook-plugin-sharing/buttons.js"></script>
        
    
        
        <script src="gitbook/gitbook-plugin-fontsettings/fontsettings.js"></script>
        
    

    </body>
</html>

